<template>
	<el-drawer :title="`详情 - ${model.equipName}`" v-model="visible" size="40%" destroy-on-close>
		<el-container>
			<el-main>
				<el-table :data="subjectData">
					<el-table-column type="index" width="30" />
					<el-table-column prop="subjectCode" label="点检项编号" width="100" />
					<el-table-column prop="subjectName" label="点检项名称" width="140" />
					<el-table-column prop="content" label="点检项内容" width="160" />
					<el-table-column prop="standard" label="点检项标准" />
				</el-table>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
export default {
    data() {
        return {
            visible: false,
            model: {},
            subjectData: [],
        };
    },
    methods: {
        async open(item) {
            this.model = item;
            const resp = await this.$API.equipchecksubject.list.get();
            this.subjectData = resp.data.filter(s => item.subjectCodes.includes(s.subjectCode));
            this.visible = true;
        }
    }
}
</script>
